package com.flyu.dao.user;

import com.flyu.pojo.User;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface UserDao {
    // 得到要登录的用户
    public User getLoginUser(Connection connection, String userCode) throws SQLException;
    // 根据uid查询用户
    public User getUserById(Connection connection, int id) throws SQLException;
    // 修改当前用户密码
    public int updatePwd(Connection connection, int id, String password) throws SQLException;
    // 根据用户名或角色查询用户总数
    public int getUserCount(Connection connection, String username, int userRole) throws SQLException;
    // 获取用户列表
    public List<User> getUserList(Connection connection, String username, int userRole, int currentPage, int pageSize) throws SQLException;
    // 添加用户
    public int addUser(Connection connection, User user) throws SQLException;
    // 删除指定用户
    public int delUser(Connection connection, int uid) throws SQLException;
    // 保存修改
    public int modifySave(Connection connection, Object[] params) throws SQLException;


}
